package entity;
// default package

import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Infotypes entity.
 * 
 * @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "infotypes", catalog = "house")
public class Infotypes implements java.io.Serializable {

	// Fields

	private Integer id;
	private String itName;
	private Set<Usedhouse> usedhouses = new HashSet<Usedhouse>(0);

	// Constructors

	/** default constructor */
	public Infotypes() {
	}

	/** minimal constructor */
	public Infotypes(String itName) {
		this.itName = itName;
	}

	/** full constructor */
	public Infotypes(String itName, Set<Usedhouse> usedhouses) {
		this.itName = itName;
		this.usedhouses = usedhouses;
	}

	// Property accessors
	@Id
	@GeneratedValue
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@Column(name = "it_name", nullable = false, length = 20)
	public String getItName() {
		return this.itName;
	}

	public void setItName(String itName) {
		this.itName = itName;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "infotypes")
	public Set<Usedhouse> getUsedhouses() {
		return this.usedhouses;
	}

	public void setUsedhouses(Set<Usedhouse> usedhouses) {
		this.usedhouses = usedhouses;
	}

}